<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">
<script>
    (function () {
        if ('') {
            if (prompt('请输入文章密码') !== '') {
                alert('密码错误！');
                if (history.length === 1) {
                    location.replace("https://google.com"); // 这里替换成你的首页
                } else {
                    history.back();
                }
            }
        }
    })();
</script>








<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="命令行,工具,python,">










<meta name="description" content="安装python312345678910111213141516sudo yum install python34$ curl -O https://bootstrap.pypa.io/get-pip.py$ sudo /usr/bin/python3.4 get-pip.pyLooking in indexes: http://mirrors.tencentyun.com/pypi/simple">
<meta name="keywords" content="命令行,工具,python">
<meta property="og:type" content="article">
<meta property="og:title" content="Python命令行工具">
<meta property="og:url" content="http://yoursite.com/2018/11/29/Python命令行工具/index.html">
<meta property="og:site_name" content="苏生不惑的博客">
<meta property="og:description" content="安装python312345678910111213141516sudo yum install python34$ curl -O https://bootstrap.pypa.io/get-pip.py$ sudo /usr/bin/python3.4 get-pip.pyLooking in indexes: http://mirrors.tencentyun.com/pypi/simple">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://iocaffcdn.phphub.org/uploads/images/201903/07/24141/eIw8MARlWr.png!large">
<meta property="og:updated_time" content="2019-11-06T09:06:48.238Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Python命令行工具">
<meta name="twitter:description" content="安装python312345678910111213141516sudo yum install python34$ curl -O https://bootstrap.pypa.io/get-pip.py$ sudo /usr/bin/python3.4 get-pip.pyLooking in indexes: http://mirrors.tencentyun.com/pypi/simple">
<meta name="twitter:image" content="https://iocaffcdn.phphub.org/uploads/images/201903/07/24141/eIw8MARlWr.png!large">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/11/29/Python命令行工具/">



<meta name="referrer" content="never"> ​​​​


  <title>Python命令行工具 | 苏生不惑的博客</title>
  








</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">苏生不惑的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/11/29/Python命令行工具/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="苏生不惑">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏生不惑的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Python命令行工具</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-11-29T11:50:37+08:00">
                2018-11-29
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>次
            </span>
          

          
            <div class="post-wordcount">
              
                
                  <span class="post-meta-divider">|</span>
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  4.8k 字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  25 分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="安装python3"><a href="#安装python3" class="headerlink" title="安装python3"></a>安装python3</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">sudo yum install python34</span><br><span class="line">$ curl -O https:<span class="comment">//bootstrap.pypa.io/get-pip.py</span></span><br><span class="line">$ sudo /usr/bin/python3<span class="number">.4</span> get-pip.py</span><br><span class="line">Looking <span class="keyword">in</span> indexes: http:<span class="comment">//mirrors.tencentyun.com/pypi/simple</span></span><br><span class="line">Collecting pip</span><br><span class="line">  Downloading http:<span class="comment">//mirrors.tencentyun.com/pypi/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB)</span></span><br><span class="line">    <span class="number">100</span>% |████████████████████████████████| <span class="number">1.4</span>MB <span class="number">2.9</span>MB/s</span><br><span class="line">Collecting setuptools</span><br><span class="line">  Downloading http:<span class="comment">//mirrors.tencentyun.com/pypi/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl (575kB)</span></span><br><span class="line">    <span class="number">100</span>% |████████████████████████████████| <span class="number">583</span>kB <span class="number">2.7</span>MB/s</span><br><span class="line">Collecting wheel</span><br><span class="line">[root@CentOS72 ~]# python3 -V</span><br><span class="line">Python <span class="number">3.4</span><span class="number">.3</span></span><br><span class="line">[root@su ~]# pip3 -V</span><br><span class="line">pip <span class="number">19.0</span><span class="number">.3</span> <span class="keyword">from</span> /usr/lib/python3<span class="number">.4</span>/site-packages/pip (python <span class="number">3.4</span>)</span><br><span class="line">https:<span class="comment">//blog.huzhifeng.com/2016/09/12/CentOS-7-Install-Python3-pip3/</span></span><br></pre></td></tr></table></figure>
<h3 id="显示Python包"><a href="#显示Python包" class="headerlink" title="显示Python包"></a>显示Python包</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//pip包网站 https://pypi.org/search/?q=cheat</span></span><br><span class="line"><span class="comment">//命令行安装目录 which httpstat /d/python/srcripts/</span></span><br><span class="line">pip install https:<span class="comment">//github.com/mher/flower/zipball/master</span></span><br><span class="line">$ pip list</span><br><span class="line">Package              Version</span><br><span class="line">-------------------- ---------</span><br><span class="line">aiohttp              <span class="number">3.4</span><span class="number">.4</span></span><br><span class="line">alembic              <span class="number">1.0</span><span class="number">.0</span></span><br><span class="line">amqp                 <span class="number">2.3</span><span class="number">.2</span></span><br><span class="line">asn1crypto           <span class="number">0.24</span><span class="number">.0</span></span><br><span class="line">astral               <span class="number">1.6</span><span class="number">.1</span></span><br><span class="line"><span class="keyword">async</span>-timeout        <span class="number">3.0</span><span class="number">.0</span></span><br><span class="line">attrs                <span class="number">18.2</span><span class="number">.0</span></span><br><span class="line">Automat              <span class="number">0.7</span><span class="number">.0</span></span><br><span class="line">Babel                <span class="number">2.6</span><span class="number">.0</span></span><br><span class="line">bcrypt               <span class="number">3.1</span><span class="number">.4</span></span><br><span class="line">billiard             <span class="number">3.5</span><span class="number">.0</span><span class="number">.4</span></span><br><span class="line">bleach               <span class="number">2.1</span><span class="number">.4</span></span><br><span class="line">boto3                <span class="number">1.4</span><span class="number">.7</span></span><br><span class="line">botocore             <span class="number">1.7</span><span class="number">.48</span></span><br><span class="line">cchardet             <span class="number">2.1</span><span class="number">.4</span></span><br><span class="line">celery               <span class="number">4.2</span><span class="number">.1</span></span><br><span class="line">certifi              <span class="number">2018.8</span><span class="number">.24</span></span><br><span class="line">cffi                 <span class="number">1.11</span><span class="number">.5</span></span><br><span class="line">chardet              <span class="number">3.0</span><span class="number">.4</span></span><br><span class="line">click                <span class="number">6.7</span></span><br><span class="line">colorama             <span class="number">0.3</span><span class="number">.9</span></span><br><span class="line">constantly           <span class="number">15.1</span><span class="number">.0</span></span><br><span class="line">contextlib2          <span class="number">0.5</span><span class="number">.5</span></span><br><span class="line">cryptography         <span class="number">2.3</span><span class="number">.1</span></span><br><span class="line">defusedxml           <span class="number">0.5</span><span class="number">.0</span></span><br><span class="line">docutils             <span class="number">0.14</span></span><br><span class="line">et-xmlfile           <span class="number">1.0</span><span class="number">.1</span></span><br><span class="line">Flask                <span class="number">0.12</span><span class="number">.4</span></span><br><span class="line">Flask-AppBuilder     <span class="number">1.12</span><span class="number">.1</span></span><br><span class="line">Flask-Babel          <span class="number">0.11</span><span class="number">.1</span></span><br><span class="line">Flask-Caching        <span class="number">1.4</span><span class="number">.0</span></span><br><span class="line">Flask-Compress       <span class="number">1.4</span><span class="number">.0</span></span><br><span class="line">Flask-Login          <span class="number">0.4</span><span class="number">.1</span></span><br><span class="line">Flask-Migrate        <span class="number">2.2</span><span class="number">.1</span></span><br><span class="line">Flask-OpenID         <span class="number">1.2</span><span class="number">.5</span></span><br><span class="line">Flask-Script         <span class="number">2.0</span><span class="number">.6</span></span><br><span class="line">Flask-SQLAlchemy     <span class="number">2.3</span><span class="number">.2</span></span><br><span class="line">Flask-Testing        <span class="number">0.7</span><span class="number">.1</span></span><br><span class="line">Flask-WTF            <span class="number">0.14</span><span class="number">.2</span></span><br><span class="line">flower               <span class="number">0.9</span><span class="number">.2</span></span><br><span class="line">future               <span class="number">0.16</span><span class="number">.0</span></span><br><span class="line">geographiclib        <span class="number">1.49</span></span><br><span class="line">geopy                <span class="number">1.16</span><span class="number">.0</span></span><br><span class="line">gunicorn             <span class="number">19.9</span><span class="number">.0</span></span><br><span class="line">homeassistant        <span class="number">0.80</span><span class="number">.3</span></span><br><span class="line">html5lib             <span class="number">1.0</span><span class="number">.1</span></span><br><span class="line">humanize             <span class="number">0.5</span><span class="number">.1</span></span><br><span class="line">hyperlink            <span class="number">18.0</span><span class="number">.0</span></span><br><span class="line">idna                 <span class="number">2.7</span></span><br><span class="line">ijson                <span class="number">2.3</span></span><br><span class="line">incremental          <span class="number">17.5</span><span class="number">.0</span></span><br><span class="line">isodate              <span class="number">0.6</span><span class="number">.0</span></span><br><span class="line">itsdangerous         <span class="number">0.24</span></span><br><span class="line">jdcal                <span class="number">1.4</span></span><br><span class="line">Jinja2               <span class="number">2.10</span></span><br><span class="line">jmespath             <span class="number">0.9</span><span class="number">.3</span></span><br><span class="line">jsonlines            <span class="number">1.2</span><span class="number">.0</span></span><br><span class="line">jsonschema           <span class="number">2.6</span><span class="number">.0</span></span><br><span class="line">kombu                <span class="number">4.2</span><span class="number">.1</span></span><br><span class="line">linear-tsv           <span class="number">1.1</span><span class="number">.0</span></span><br><span class="line">Mako                 <span class="number">1.0</span><span class="number">.7</span></span><br><span class="line">Markdown             <span class="number">3.0</span><span class="number">.1</span></span><br><span class="line">MarkupSafe           <span class="number">1.0</span></span><br><span class="line">multidict            <span class="number">4.4</span><span class="number">.2</span></span><br><span class="line">mysqlclient          <span class="number">1.3</span><span class="number">.13</span></span><br><span class="line">numpy                <span class="number">1.15</span><span class="number">.1</span></span><br><span class="line">openpyxl             <span class="number">2.4</span><span class="number">.11</span></span><br><span class="line">pandas               <span class="number">0.23</span><span class="number">.4</span></span><br><span class="line">parsedatetime        <span class="number">2.4</span></span><br><span class="line">pathlib2             <span class="number">2.3</span><span class="number">.2</span></span><br><span class="line">pip                  <span class="number">18.1</span></span><br><span class="line">polyline             <span class="number">1.3</span><span class="number">.2</span></span><br><span class="line">pure-sasl            <span class="number">0.5</span><span class="number">.1</span></span><br><span class="line">pycparser            <span class="number">2.18</span></span><br><span class="line">pydruid              <span class="number">0.4</span><span class="number">.5</span></span><br><span class="line">PyHamcrest           <span class="number">1.9</span><span class="number">.0</span></span><br><span class="line">PyHive               <span class="number">0.6</span><span class="number">.0</span></span><br><span class="line">PyJWT                <span class="number">1.6</span><span class="number">.4</span></span><br><span class="line">PyMySQL              <span class="number">0.9</span><span class="number">.2</span></span><br><span class="line">python-dateutil      <span class="number">2.7</span><span class="number">.3</span></span><br><span class="line">python-editor        <span class="number">1.0</span><span class="number">.3</span></span><br><span class="line">python-geohash       <span class="number">0.8</span><span class="number">.5</span></span><br><span class="line">python3-openid       <span class="number">3.1</span><span class="number">.0</span></span><br><span class="line">pytz                 <span class="number">2018.5</span></span><br><span class="line">PyYAML               <span class="number">3.13</span></span><br><span class="line">requests             <span class="number">2.19</span><span class="number">.1</span></span><br><span class="line">rfc3986              <span class="number">1.1</span><span class="number">.0</span></span><br><span class="line">s3transfer           <span class="number">0.1</span><span class="number">.13</span></span><br><span class="line">selenium             <span class="number">3.14</span><span class="number">.0</span></span><br><span class="line">setuptools           <span class="number">39.0</span><span class="number">.1</span></span><br><span class="line">simplejson           <span class="number">3.16</span><span class="number">.0</span></span><br><span class="line">six                  <span class="number">1.11</span><span class="number">.0</span></span><br><span class="line">SQLAlchemy           <span class="number">1.2</span><span class="number">.11</span></span><br><span class="line">SQLAlchemy-Utils     <span class="number">0.33</span><span class="number">.3</span></span><br><span class="line">sqlparse             <span class="number">0.2</span><span class="number">.4</span></span><br><span class="line">superset             <span class="number">0.28</span><span class="number">.0</span></span><br><span class="line">tableschema          <span class="number">1.2</span><span class="number">.5</span></span><br><span class="line">tabulator            <span class="number">1.17</span><span class="number">.0</span></span><br><span class="line">thrift               <span class="number">0.11</span><span class="number">.0</span></span><br><span class="line">thrift-sasl          <span class="number">0.3</span><span class="number">.0</span></span><br><span class="line">tornado              <span class="number">5.1</span></span><br><span class="line">Twisted              <span class="number">18.9</span><span class="number">.0</span></span><br><span class="line">unicodecsv           <span class="number">0.14</span><span class="number">.1</span></span><br><span class="line">Unidecode            <span class="number">1.0</span><span class="number">.22</span></span><br><span class="line">urllib3              <span class="number">1.23</span></span><br><span class="line">vine                 <span class="number">1.1</span><span class="number">.4</span></span><br><span class="line">virtualenv           <span class="number">16.0</span><span class="number">.0</span></span><br><span class="line">voluptuous           <span class="number">0.11</span><span class="number">.5</span></span><br><span class="line">voluptuous-serialize <span class="number">2.0</span><span class="number">.0</span></span><br><span class="line">webencodings         <span class="number">0.5</span><span class="number">.1</span></span><br><span class="line">Werkzeug             <span class="number">0.14</span><span class="number">.1</span></span><br><span class="line">wheel                <span class="number">0.32</span><span class="number">.1</span></span><br><span class="line">WTForms              <span class="number">2.2</span><span class="number">.1</span></span><br><span class="line">xlrd                 <span class="number">1.1</span><span class="number">.0</span></span><br><span class="line">yarl                 <span class="number">1.2</span><span class="number">.6</span></span><br><span class="line">youtube-dl           <span class="number">2018.10</span><span class="number">.5</span></span><br><span class="line">zope.interface       <span class="number">4.5</span><span class="number">.0</span></span><br></pre></td></tr></table></figure>
<h3 id="视频下载you-get"><a href="#视频下载you-get" class="headerlink" title="视频下载you-get"></a>视频下载you-get</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//https://github.com/soimort/you-get</span></span><br><span class="line">$ you-get <span class="string">'https://www.youtube.com/watch?v=jNQXAC9IVRw'</span></span><br><span class="line">site:                YouTube</span><br><span class="line">title:               Me at the zoo</span><br><span class="line">stream:</span><br><span class="line">    - itag:          <span class="number">43</span></span><br><span class="line">      container:     webm</span><br><span class="line">      quality:       medium</span><br><span class="line">      size:          <span class="number">0.5</span> MiB (<span class="number">564215</span> bytes)</span><br><span class="line">    # download-with: you-get --itag=43 [URL]</span><br><span class="line"></span><br><span class="line">Downloading Me at the zoo.webm ...</span><br><span class="line"> <span class="number">100</span>% (  <span class="number">0.5</span>/  <span class="number">0.5</span>MB) ├██████████████████████████████████┤[<span class="number">1</span>/<span class="number">1</span>]    <span class="number">6</span> MB/s</span><br><span class="line"></span><br><span class="line">Saving Me at the zoo.en.srt ... Done.</span><br><span class="line">$ you-get https:<span class="comment">//stallman.org/rms.jpg</span></span><br><span class="line">Site:       stallman.org</span><br><span class="line">Title:      rms</span><br><span class="line">Type:       JPEG Image (image/jpeg)</span><br><span class="line">Size:       <span class="number">0.06</span> MiB (<span class="number">66482</span> Bytes)</span><br><span class="line"></span><br><span class="line">Downloading rms.jpg ...</span><br><span class="line"><span class="number">100.0</span>% (  <span class="number">0.1</span>/<span class="number">0.1</span>  MB) ├████████████████████████████████████████┤[<span class="number">1</span>/<span class="number">1</span>]  <span class="number">127</span> kB/s</span><br><span class="line"></span><br><span class="line">$ pip3 install -U lulu</span><br><span class="line">$ lulu https:<span class="comment">//www.bilibili.com/video/av18295259/</span></span><br><span class="line">site:                Bilibili</span><br><span class="line">title:               【中文八级】俄罗斯人的名字超乎你的想象</span><br><span class="line">stream:</span><br><span class="line">    - format:        flv720</span><br><span class="line">      container:     flv</span><br><span class="line">      size:          <span class="number">175.4</span> MiB (<span class="number">183914793</span> bytes)</span><br><span class="line">    # download-with: lulu --format=flv720 [URL]</span><br><span class="line"></span><br><span class="line">Downloading 【中文八级】俄罗斯人的名字超乎你的想象.flv ...</span><br><span class="line"> <span class="number">100</span>% (<span class="number">175.4</span>/<span class="number">175.4</span>MB) ├████████████████████████████████████████┤[<span class="number">1</span>/<span class="number">1</span>]    <span class="number">3</span> MB/s</span><br><span class="line"></span><br><span class="line">Downloading 【中文八级】俄罗斯人的名字超乎你的想象.cmt.xml ...</span><br></pre></td></tr></table></figure>
<h3 id="httpie"><a href="#httpie" class="headerlink" title="httpie"></a>httpie</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">pip install --upgrade httpie</span><br><span class="line">http httpie.org</span><br><span class="line">HTTP/<span class="number">1.1</span> <span class="number">301</span> Moved Permanently</span><br><span class="line">CF-RAY: <span class="number">486</span>fc237347a7948-LAX</span><br><span class="line">Cache-Control: max-age=<span class="number">3600</span></span><br><span class="line">Connection: keep-alive</span><br><span class="line"><span class="built_in">Date</span>: Mon, <span class="number">10</span> Dec <span class="number">2018</span> <span class="number">12</span>:<span class="number">36</span>:<span class="number">42</span> GMT</span><br><span class="line">Expires: Mon, <span class="number">10</span> Dec <span class="number">2018</span> <span class="number">13</span>:<span class="number">36</span>:<span class="number">42</span> GMT</span><br><span class="line">Location: https:<span class="comment">//httpie.org/</span></span><br><span class="line">Server: cloudflare</span><br><span class="line">Transfer-Encoding: chunked</span><br><span class="line">Vary: Accept-Encoding</span><br><span class="line">$ http PUT example.org X-API-Token:<span class="number">123</span> name=John</span><br><span class="line">$ http DELETE example.org/todos/<span class="number">7</span></span><br><span class="line">$docker pull kennethreitz/httpbin</span><br><span class="line">$docker run -p <span class="number">80</span>:<span class="number">80</span> kennethreitz/httpbin</span><br><span class="line">http tonydeng.github.io/blog/<span class="number">2015</span>/<span class="number">07</span>/<span class="number">10</span>/httpie-howto/ User-Agent:Xmodlo/<span class="number">1.0</span> Referer:http:<span class="comment">//tonydeng.github.io</span></span><br><span class="line">GET /blog/<span class="number">2015</span>/<span class="number">07</span>/<span class="number">10</span>/httpie-howto/ HTTP/<span class="number">1.1</span></span><br><span class="line">Accept: *<span class="comment">/*</span></span><br><span class="line"><span class="comment">Accept-Encoding: gzip, deflate</span></span><br><span class="line"><span class="comment">Connection: keep-alive</span></span><br><span class="line"><span class="comment">Host: tonydeng.github.io</span></span><br><span class="line"><span class="comment">Referer: http://tonydeng.github.io</span></span><br><span class="line"><span class="comment">User-Agent: Xmodlo/1.0</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">http PUT tonydeng.github.io name='Tony Deng' email='tonydeng@email.com'</span></span><br><span class="line"><span class="comment">http -f POST tonydeng.github.io name='Tony Deng' email='tonydeng@email.com'</span></span><br><span class="line"><span class="comment">-f 选项使http命令序列化数据字段，并将Content-Type设置为application/x-www-form-urlencoded;charset=utf-8</span></span><br><span class="line"><span class="comment">当你不指定Content-Type发送请求参数时，它们就会自动序列化为JSON对象。</span></span><br><span class="line"><span class="comment">https://tonydeng.github.io/2015/07/10/httpie-howto/</span></span><br><span class="line"><span class="comment">http POST tonydeng.github.io name='Tony Deng' email='tonydeng@email.com'</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">POST / HTTP/1.1</span></span><br><span class="line"><span class="comment">Accept: application/json</span></span><br><span class="line"><span class="comment">Accept-Encoding: gzip, deflate</span></span><br><span class="line"><span class="comment">Connection: keep-alive</span></span><br><span class="line"><span class="comment">Content-Length: 52</span></span><br><span class="line"><span class="comment">Content-Type: application/json</span></span><br><span class="line"><span class="comment">Host: tonydeng.github.io</span></span><br><span class="line"><span class="comment">User-Agent: HTTPie/0.9.2</span></span><br><span class="line"><span class="comment">&#123;</span></span><br><span class="line"><span class="comment">    "email": "tonydeng@email.com",</span></span><br><span class="line"><span class="comment">    "name": "Tony Deng"</span></span><br><span class="line"><span class="comment">&#125;</span></span><br><span class="line"><span class="comment">http POST tonydeng.github.io &lt; my_info.json</span></span><br><span class="line"><span class="comment">或:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">echo '&#123;"name": "Tony Deng","email": "tonydeng@email.com"&#125;' | http POST tonydeng.github.io</span></span><br></pre></td></tr></table></figure>
<h3 id="清晰易读的-cURL-工具httpstat"><a href="#清晰易读的-cURL-工具httpstat" class="headerlink" title="清晰易读的 cURL 工具httpstat"></a>清晰易读的 cURL 工具httpstat</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">pip install httpstat</span><br><span class="line">wget https:<span class="comment">//raw.githubusercontent.com/reorx/httpstat/master/httpstat.py</span></span><br><span class="line"> go get github.com/davecheney/httpstat </span><br><span class="line"> https:<span class="comment">//learnku.com/articles/24048</span></span><br><span class="line">$ httpstat httpbin.org</span><br><span class="line">Connected to <span class="number">54.152</span><span class="number">.127</span><span class="number">.232</span>:<span class="number">80</span> <span class="keyword">from</span> <span class="number">10.235</span><span class="number">.51</span><span class="number">.43</span>:<span class="number">55118</span></span><br><span class="line"></span><br><span class="line">HTTP/<span class="number">1.1</span> <span class="number">200</span> OK</span><br><span class="line">Connection: keep-alive</span><br><span class="line">Server: gunicorn/<span class="number">19.9</span><span class="number">.0</span></span><br><span class="line"><span class="built_in">Date</span>: Mon, <span class="number">10</span> Dec <span class="number">2018</span> <span class="number">12</span>:<span class="number">39</span>:<span class="number">33</span> GMT</span><br><span class="line">Content-Type: text/html; charset=utf<span class="number">-8</span></span><br><span class="line">Content-Length: <span class="number">10122</span></span><br><span class="line">Access-Control-Allow-Origin: *</span><br><span class="line">Access-Control-Allow-Credentials: <span class="literal">true</span></span><br><span class="line">Via: <span class="number">1.1</span> vegur</span><br><span class="line"></span><br><span class="line">Body stored <span class="keyword">in</span>: C:\Users\suping3\AppData\Local\Temp\tmppkgeite_</span><br><span class="line"></span><br><span class="line">  DNS Lookup   TCP Connection   Server Processing   Content Transfer</span><br><span class="line">[    <span class="number">250</span>ms   |      <span class="number">234</span>ms     |       <span class="number">265</span>ms       |       <span class="number">15</span>ms       ]</span><br><span class="line">             |                |                   |                  |</span><br><span class="line">    namelookup:<span class="number">250</span>ms          |                   |                  |</span><br><span class="line">                        connect:<span class="number">484</span>ms             |                  |</span><br><span class="line">                                      starttransfer:<span class="number">749</span>ms            |</span><br><span class="line">                                                                 total:<span class="number">764</span>ms</span><br><span class="line">httpstat httpbin.org/post -X POST --data-urlencode <span class="string">"a=b"</span> -v</span><br><span class="line">        https:<span class="comment">//wi1dcard.cn/posts/easier-curl-with-colors/</span></span><br></pre></td></tr></table></figure>
<h3 id="shadowsocks"><a href="#shadowsocks" class="headerlink" title="shadowsocks"></a>shadowsocks</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">pip install shadowsocks</span><br><span class="line">ssserver -p <span class="number">443</span> -k password -m rc4-md5</span><br><span class="line">sudo ssserver -p <span class="number">443</span> -k password -m rc4-md5 --user nobody -d start</span><br><span class="line">sudo ssserver -d stop</span><br><span class="line"> less /<span class="keyword">var</span>/log/shadowsocks.log</span><br></pre></td></tr></table></figure>
<h3 id="增强型语法高亮mycli"><a href="#增强型语法高亮mycli" class="headerlink" title="增强型语法高亮mycli"></a>增强型语法高亮mycli</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mycli -u用户名 -p密码</span><br></pre></td></tr></table></figure>
<h3 id="中文分词"><a href="#中文分词" class="headerlink" title="中文分词"></a>中文分词</h3><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> snownlp <span class="keyword">import</span> SnowNLP</span><br><span class="line"></span><br><span class="line">s = SnowNLP(u<span class="string">'这个东西真心很赞'</span>)</span><br><span class="line"></span><br><span class="line">s.words         # [u'这个', u'东西', u'真心',</span><br><span class="line">                #  u'很', u'赞']</span><br><span class="line"></span><br><span class="line">s.tags          # [(u'这个', u'r'), (u'东西', u'n'),</span><br><span class="line">                #  (u'真心', u'd'), (u'很', u'd'),</span><br><span class="line">                #  (u'赞', u'Vg')]</span><br><span class="line"></span><br><span class="line">s.sentiments    # 0.9769663402895832 positive的概率</span><br><span class="line"></span><br><span class="line">s.pinyin        # [u'zhe', u'ge', u'dong', u'xi',</span><br><span class="line">                #  u'zhen', u'xin', u'hen', u'zan']</span><br><span class="line"></span><br><span class="line">s = SnowNLP(u<span class="string">'「繁體字」「繁體中文」的叫法在臺灣亦很常見。'</span>)</span><br><span class="line"></span><br><span class="line">s.han           # u'「繁体字」「繁体中文」的叫法</span><br><span class="line">                # 在台湾亦很常见。'</span><br><span class="line"></span><br><span class="line">text = u<span class="string">''</span><span class="string">'</span></span><br><span class="line"><span class="string">自然语言处理是计算机科学领域与人工智能领域中的一个重要方向。</span></span><br><span class="line"><span class="string">它研究能实现人与计算机之间用自然语言进行有效通信的各种理论和方法。</span></span><br><span class="line"><span class="string">自然语言处理是一门融语言学、计算机科学、数学于一体的科学。</span></span><br><span class="line"><span class="string">因此，这一领域的研究将涉及自然语言，即人们日常使用的语言，</span></span><br><span class="line"><span class="string">所以它与语言学的研究有着密切的联系，但又有重要的区别。</span></span><br><span class="line"><span class="string">自然语言处理并不是一般地研究自然语言，</span></span><br><span class="line"><span class="string">而在于研制能有效地实现自然语言通信的计算机系统，</span></span><br><span class="line"><span class="string">特别是其中的软件系统。因而它是计算机科学的一部分。</span></span><br><span class="line"><span class="string">'</span><span class="string">''</span></span><br><span class="line"></span><br><span class="line">s = SnowNLP(text)</span><br><span class="line"></span><br><span class="line">s.keywords(3)	# [u'语言', u'自然', u'计算机']</span><br><span class="line"></span><br><span class="line">s.summary(3)	# [u'因而它是计算机科学的一部分',</span><br><span class="line">                #  u'自然语言处理是一门融语言学、计算机科学、</span><br><span class="line">				#	 数学于一体的科学',</span><br><span class="line">				#  u'自然语言处理是计算机科学领域与人工智能</span><br><span class="line">				#	 领域中的一个重要方向']</span><br><span class="line">s.sentences</span><br><span class="line"></span><br><span class="line">s = SnowNLP([[u<span class="string">'这篇'</span>, u<span class="string">'文章'</span>],</span><br><span class="line">             [u<span class="string">'那篇'</span>, u<span class="string">'论文'</span>],</span><br><span class="line">             [u<span class="string">'这个'</span>]])</span><br><span class="line">s.tf</span><br><span class="line">s.idf</span><br><span class="line">s.sim([u'文章'])# [0.3756070762985226, 0, 0]</span><br></pre></td></tr></table></figure>
<h3 id="测试你的上下行网速"><a href="#测试你的上下行网速" class="headerlink" title="测试你的上下行网速"></a>测试你的上下行网速</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">pip install speedtest-cli --upgrade</span><br><span class="line">[root@VM_0_14_centos ~]# speedtest  --share</span><br><span class="line">Retrieving speedtest.net configuration...</span><br><span class="line">Testing <span class="keyword">from</span> Tencent cloud computing (<span class="number">118.24</span><span class="number">.158</span><span class="number">.116</span>)...</span><br><span class="line">Retrieving speedtest.net server list...</span><br><span class="line">Selecting best server based on ping...</span><br><span class="line">Hosted by Beijing Broadband Network (Beijing) [<span class="number">1.69</span> km]: <span class="number">36.987</span> ms</span><br><span class="line">Testing download speed................................................................................</span><br><span class="line">Download: <span class="number">21.77</span> Mbit/s</span><br><span class="line">Testing upload speed................................................................................................</span><br><span class="line">Upload: <span class="number">1.10</span> Mbit/s</span><br><span class="line">Share results: http:<span class="comment">//www.speedtest.net/result/7842317337.png</span></span><br></pre></td></tr></table></figure>
<h3 id="cheat"><a href="#cheat" class="headerlink" title="cheat"></a>cheat</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br></pre></td><td class="code"><pre><span class="line">pip install cheat</span><br><span class="line">$ cheat curl</span><br><span class="line"># Download a single file</span><br><span class="line">curl http:<span class="comment">//path.to.the/file</span></span><br><span class="line"></span><br><span class="line"># Download a file and specify a new filename</span><br><span class="line">curl http:<span class="comment">//example.com/file.zip -o new_file.zip</span></span><br><span class="line"></span><br><span class="line"># Download multiple files</span><br><span class="line">curl -O URLOfFirstFile -O URLOfSecondFile</span><br><span class="line"></span><br><span class="line"># Download all sequentially numbered files (1-24)</span><br><span class="line">curl http:<span class="comment">//example.com/pic[1-24].jpg</span></span><br><span class="line"></span><br><span class="line"># Download a file and pass HTTP Authentication</span><br><span class="line">curl -u username:password URL</span><br><span class="line"></span><br><span class="line"># Download a file with a Proxy</span><br><span class="line">curl -x proxysever.server.com:PORT http:<span class="comment">//addressiwantto.access</span></span><br><span class="line"></span><br><span class="line"># Download a file from FTP</span><br><span class="line">curl -u username:password -O ftp:<span class="comment">//example.com/pub/file.zip</span></span><br><span class="line"></span><br><span class="line"># Get an FTP directory listing</span><br><span class="line">curl ftp:<span class="comment">//username:password@example.com</span></span><br><span class="line"></span><br><span class="line"># Resume a previously failed download</span><br><span class="line">curl -C - -o partial_file.zip http:<span class="comment">//example.com/file.zip</span></span><br><span class="line"></span><br><span class="line"># Fetch only the HTTP headers from a response</span><br><span class="line">curl -I http:<span class="comment">//example.com</span></span><br><span class="line"></span><br><span class="line"># Fetch your external IP and network info as JSON</span><br><span class="line">curl http:<span class="comment">//ifconfig.me/all/json</span></span><br><span class="line"></span><br><span class="line"># Limit the rate of a download</span><br><span class="line">curl --limit-rate <span class="number">1000</span>B -O http:<span class="comment">//path.to.the/file</span></span><br><span class="line"></span><br><span class="line"># Get your global IP</span><br><span class="line">curl httpbin.org/ip</span><br><span class="line"></span><br><span class="line"># Get only the HTTP status code</span><br><span class="line">curl -o /dev/<span class="literal">null</span> -w <span class="string">'%&#123;http_code&#125;\n'</span> -s -I URL</span><br><span class="line"></span><br><span class="line">curl cht.sh/curl</span><br><span class="line">curl cht.sh/php/array_map</span><br></pre></td></tr></table></figure>
<h3 id="zhihu"><a href="#zhihu" class="headerlink" title="zhihu"></a>zhihu</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">$ pip install zhihuapi</span><br><span class="line"><span class="keyword">import</span> zhihuapi <span class="keyword">as</span> api</span><br><span class="line"></span><br><span class="line"><span class="keyword">with</span> open(<span class="string">'cookie'</span>) <span class="keyword">as</span> f:</span><br><span class="line">    api.cookie(f.read())</span><br><span class="line"></span><br><span class="line">data = api.user(<span class="string">'zhihuadmin'</span>).profile()</span><br><span class="line">print(data)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="string">"url_token"</span>: <span class="string">"zhihuadmin"</span>,</span><br><span class="line">    <span class="string">"avatar_url"</span>: <span class="string">"https://pic3.zhimg.com/34bf96bf5584ac4b5264bd7ed4fdbc5a_is.jpg"</span>,</span><br><span class="line">    <span class="string">"avatar_url_template"</span>: <span class="string">"https://pic3.zhimg.com/34bf96bf5584ac4b5264bd7ed4fdbc5a_&#123;size&#125;.jpg"</span>,</span><br><span class="line">    <span class="string">"type"</span>: <span class="string">"people"</span>,</span><br><span class="line">    <span class="string">"name"</span>: <span class="string">"知乎小管家"</span>,</span><br><span class="line">    <span class="string">"headline"</span>: <span class="string">"欢迎反馈问题和建议！"</span>,</span><br><span class="line">    <span class="string">"is_org"</span>: <span class="literal">false</span>,</span><br><span class="line">    <span class="string">"url"</span>: <span class="string">"https://www.zhihu.com/people/zhihuadmin"</span>,</span><br><span class="line">    <span class="string">"badge"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">            <span class="string">"type"</span>: <span class="string">"identity"</span>,</span><br><span class="line">            <span class="string">"description"</span>: <span class="string">"知乎官方帐号"</span></span><br><span class="line">        &#125;</span><br><span class="line">    ],</span><br><span class="line">    <span class="string">"user_type"</span>: <span class="string">"people"</span>,</span><br><span class="line">    <span class="string">"is_advertiser"</span>: <span class="literal">false</span>,</span><br><span class="line">    <span class="string">"id"</span>: <span class="string">"3d198a56310c02c4a83efb9f4a4c027e"</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="微信机器人"><a href="#微信机器人" class="headerlink" title="微信机器人"></a>微信机器人</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">pip install -U wxpy -i <span class="string">"https://pypi.doubanio.com/simple/"</span></span><br><span class="line"># 导入模块</span><br><span class="line"><span class="keyword">from</span> wxpy <span class="keyword">import</span> *</span><br><span class="line"># 初始化机器人，扫码登陆</span><br><span class="line">bot = Bot()</span><br><span class="line"># 搜索名称含有 "游否" 的男性深圳好友</span><br><span class="line">my_friend = bot.friends().search(<span class="string">'游否'</span>, sex=MALE, city=<span class="string">"深圳"</span>)[<span class="number">0</span>]</span><br><span class="line"># 发送文本给好友</span><br><span class="line">my_friend.send(<span class="string">'Hello WeChat!'</span>)</span><br><span class="line"># 发送图片</span><br><span class="line">my_friend.send_image(<span class="string">'my_picture.jpg'</span>)</span><br><span class="line"></span><br><span class="line">pip install wechat_sender</span><br><span class="line"><span class="keyword">from</span> wxpy <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> wechat_sender <span class="keyword">import</span> *</span><br><span class="line">bot = Bot()</span><br><span class="line">listen(bot)</span><br><span class="line"># 之后 wechat_sender 将持续运行等待接收外部消息</span><br><span class="line"><span class="keyword">from</span> wechat_sender <span class="keyword">import</span> Sender</span><br><span class="line">Sender().send(<span class="string">'Hello From Wechat Sender'</span>)</span><br><span class="line"># Hello From Wechat Sender 这条消息将通过 1 中登录微信的文件助手发送给你</span><br><span class="line">pip install itchat</span><br><span class="line"><span class="keyword">import</span> itchat</span><br><span class="line"></span><br><span class="line">itchat.auto_login()</span><br><span class="line"></span><br><span class="line">itchat.send(<span class="string">'Hello, filehelper'</span>, toUserName=<span class="string">'filehelper'</span>)</span><br></pre></td></tr></table></figure>
<h3 id="数据可视化"><a href="#数据可视化" class="headerlink" title="数据可视化"></a>数据可视化</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"># Install superset</span><br><span class="line">pip install superset</span><br><span class="line"></span><br><span class="line"># Create an admin user (you will be prompted to set a username, first and last name before setting a password)</span><br><span class="line">fabmanager create-admin --app superset</span><br><span class="line"></span><br><span class="line"># Initialize the database</span><br><span class="line">superset db upgrade</span><br><span class="line"></span><br><span class="line"># Load some data to play with</span><br><span class="line">superset load_examples</span><br><span class="line"></span><br><span class="line"># Create default roles and permissions</span><br><span class="line">superset init</span><br><span class="line"></span><br><span class="line"># To start a development web server on port 8088, use -p to bind to another port</span><br><span class="line">superset runserver -d</span><br></pre></td></tr></table></figure>
<h3 id="直接执行简单-Python-表达式"><a href="#直接执行简单-Python-表达式" class="headerlink" title="直接执行简单 Python 表达式"></a>直接执行简单 Python 表达式</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">[root@VM_0_14_centos onpremise]# pip install pythonpy</span><br><span class="line">Collecting pythonpy</span><br><span class="line">  Downloading http:<span class="comment">//mirrors.tencentyun.com/pypi/packages/01/ca/3b2c0fe88b4305dcaa2c575046781338add06e5670e3baf13a378e3acbd4/pythonpy-0.4.11.tar.gz</span></span><br><span class="line">Installing collected packages: pythonpy</span><br><span class="line">  Running setup.py install <span class="keyword">for</span> pythonpy ... done</span><br><span class="line">Successfully installed pythonpy<span class="number">-0.4</span><span class="number">.11</span></span><br><span class="line">You are using pip version <span class="number">8.1</span><span class="number">.2</span>, however version <span class="number">18.1</span> is available.</span><br><span class="line">You should consider upgrading via the <span class="string">'pip install --upgrade pip'</span> command.</span><br><span class="line">[root@VM_0_14_centos onpremise]# py "248168/1024.0"</span><br><span class="line"><span class="number">242.3515625</span></span><br><span class="line">$ py <span class="string">"pandas.__version__"</span></span><br><span class="line"><span class="number">0.16</span><span class="number">.2</span></span><br><span class="line">$ py <span class="string">'math.exp(1)'</span></span><br><span class="line"><span class="number">2.71828182846</span></span><br></pre></td></tr></table></figure>
<h3 id="ppt-转-pdf-图片"><a href="#ppt-转-pdf-图片" class="headerlink" title="ppt 转 pdf 图片"></a>ppt 转 pdf 图片</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">pip install PyWin32 Pillow reportlab </span><br><span class="line">git clone https:<span class="comment">//github.com/ernestyao/PPT2PDF.git  </span></span><br><span class="line">C:\PPT2PDF-master&gt;python PPT2PDF.py test.pptx test.pdf  </span><br><span class="line">test  </span><br><span class="line">水印完成  </span><br><span class="line">准备生成C:\PPT2PDF-master\test_tank测试.pdf  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">1.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">2.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">3.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">4.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">5.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">6.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">7.</span>PNG  </span><br><span class="line">C:\PPT2PDF-master\test_tank测试\幻灯片<span class="number">8.</span>PNG  </span><br><span class="line">完成PDF合成   http:<span class="comment">//blog.51yip.com/other/1934.html</span></span><br></pre></td></tr></table></figure>
<h3 id="二维码"><a href="#二维码" class="headerlink" title="二维码"></a>二维码</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"># 逐一安装https://yfzhou.coding.me/2018/08/27/%E4%BD%BF%E7%94%A8-Python-%E7%94%9F%E6%88%90%E4%BA%8C%E7%BB%B4%E7%A0%81/</span><br><span class="line">pip install pillow</span><br><span class="line">pip install numpy</span><br><span class="line">pip install imageio</span><br><span class="line">pip install myqr</span><br><span class="line">myqr https:<span class="comment">//github.com -p github.jpg -c</span></span><br><span class="line"></span><br><span class="line">myqr https:<span class="comment">//github.com -p github.gif -c -con 1.5 -bri 1.6</span></span><br></pre></td></tr></table></figure>
<h3 id="数据分析"><a href="#数据分析" class="headerlink" title="数据分析"></a>数据分析</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">pip3 install pandas</span><br><span class="line">python3 -m pip install --upgrade pip</span><br><span class="line">python3 -m pip install jupyter</span><br><span class="line">jupyter notebook</span><br><span class="line">copy and paste one <span class="keyword">of</span> these URLs:</span><br><span class="line">        http:<span class="comment">//localhost:8889/?token=3907c3efc88d7814cf8cfee262ad277d8cf8ae2c7cf97b8d</span></span><br><span class="line">[I <span class="number">13</span>:<span class="number">51</span>:<span class="number">10.834</span> NotebookApp] Creating <span class="keyword">new</span> notebook <span class="keyword">in</span></span><br></pre></td></tr></table></figure>
<p><img src="https://iocaffcdn.phphub.org/uploads/images/201903/07/24141/eIw8MARlWr.png!large" alt="i"></p>
<h3 id="uncurl"><a href="#uncurl" class="headerlink" title="uncurl"></a>uncurl</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">Python Requests转换助手有一个很棒的开源cURL http:<span class="comment">//curl.trillworks.com   https://github.com/NickCarneiro/curlconverter</span></span><br><span class="line">pip install uncurl </span><br><span class="line">[root@su ~]# uncurl "curl 'https://pypi.python.org/pypi/uncurl' -H 'Accept-Encoding: gzip,deflate,sdch'"</span><br><span class="line">requests.get(<span class="string">"https://pypi.python.org/pypi/uncurl"</span>,</span><br><span class="line">    headers=&#123;</span><br><span class="line">        <span class="string">"Accept-Encoding"</span>: <span class="string">"gzip,deflate,sdch"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    cookies=&#123;&#125;,</span><br><span class="line">)</span><br><span class="line">echo <span class="string">"curl 'https://pypi.python.org/pypi/uncurl' -H 'Accept-Encoding: gzip,deflate,sdch'"</span>|uncurl</span><br><span class="line"><span class="keyword">import</span> uncurl</span><br><span class="line"></span><br><span class="line">&gt;&gt;&gt; print(uncurl.parse(<span class="string">"curl 'https://pypi.python.org/pypi/uncurl' -H 'Accept-Encoding: gzip,deflate,sdch'"</span>))</span><br><span class="line">requests.get(<span class="string">"https://pypi.python.org/pypi/uncurl"</span>,</span><br><span class="line">    headers=&#123;</span><br><span class="line">        <span class="string">"Accept-Encoding"</span>: <span class="string">"gzip,deflate,sdch"</span></span><br><span class="line">    &#125;,</span><br><span class="line">    cookies=&#123;&#125;,</span><br><span class="line">)</span><br><span class="line"></span><br><span class="line">https:<span class="comment">//stackoverflow.com/questions/20461194/conversion-of-curl-to-python-requests</span></span><br><span class="line">中文版stackoverflow  http:<span class="comment">//landcareweb.com/questions/35099/jiang-curlzhuan-huan-wei-pythonqing-qiu</span></span><br></pre></td></tr></table></figure>
<h3 id="词云"><a href="#词云" class="headerlink" title="词云"></a>词云</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line">$ wordcloud_cli --text mytext.txt --imagefile wordcloud.png</span><br><span class="line">If you<span class="string">'re dealing with PDF files, then pdftotext, included by default with many Linux distribution, comes in handy:</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">$ pdftotext mydocument.pdf - | wordcloud_cli --imagefile wordcloud.png</span></span><br><span class="line"><span class="string">wordcloud_cli --text in.txt --imagefile out.png --mask in.png</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">text 是词云来源，mask 是背景框架 ，imagefile 输出的文件</span></span><br><span class="line"><span class="string">wordcloud_cli.exe --text datas\data.json --fontfile assets\simkai.ttf --imagefile wordcloud.png</span></span><br><span class="line"><span class="string">wordcloud_cli --help 查看所有支持的命令参数</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">usage: wordcloud_cli [-h] [--text file] [--regexp regexp] [--stopwords file]</span></span><br><span class="line"><span class="string">                     [--imagefile file] [--fontfile path] [--mask file]</span></span><br><span class="line"><span class="string">                     [--colormask file] [--contour_width width]</span></span><br><span class="line"><span class="string">                     [--contour_color color] [--relative_scaling rs]</span></span><br><span class="line"><span class="string">                     [--margin width] [--width width] [--height height]</span></span><br><span class="line"><span class="string">                     [--color color] [--background color] [--no_collocations]</span></span><br><span class="line"><span class="string">                     [--version]</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">A simple command line interface for wordcloud module.</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">optional arguments:</span></span><br><span class="line"><span class="string">  -h, --help            show this help message and exit</span></span><br><span class="line"><span class="string">  --text file           specify file of words to build the word cloud</span></span><br><span class="line"><span class="string">                        (default: stdin)</span></span><br><span class="line"><span class="string">  --regexp regexp       override the regular expression defining what</span></span><br><span class="line"><span class="string">                        constitutes a word</span></span><br><span class="line"><span class="string">  --stopwords file      specify file of stopwords (containing one word per</span></span><br><span class="line"><span class="string">                        line) to remove from the given text after parsing</span></span><br><span class="line"><span class="string">  --imagefile file      file the completed PNG image should be written to</span></span><br><span class="line"><span class="string">                        (default: stdout)</span></span><br><span class="line"><span class="string">  --fontfile path       path to font file you wish to use (default:</span></span><br><span class="line"><span class="string">                        DroidSansMono)</span></span><br><span class="line"><span class="string">  --mask file           mask to use for the image form</span></span><br><span class="line"><span class="string">  --colormask file      color mask to use for image coloring</span></span><br><span class="line"><span class="string">  --contour_width width</span></span><br><span class="line"><span class="string">                        if greater than 0, draw mask contour (default: 0)</span></span><br><span class="line"><span class="string">  --contour_color color</span></span><br><span class="line"><span class="string">                        use given color as mask contour color - accepts any</span></span><br><span class="line"><span class="string">                        value from PIL.ImageColor.getcolor</span></span><br><span class="line"><span class="string">  --relative_scaling rs</span></span><br><span class="line"><span class="string">                        scaling of words by frequency (0 - 1)</span></span><br><span class="line"><span class="string">  --margin width        spacing to leave around words</span></span><br><span class="line"><span class="string">  --width width         define output image width</span></span><br><span class="line"><span class="string">  --height height       define output image height</span></span><br><span class="line"><span class="string">  --color color         use given color as coloring for the image - accepts</span></span><br><span class="line"><span class="string">                        any value from PIL.ImageColor.getcolor</span></span><br><span class="line"><span class="string">  --background color    use given color as background color for the image -</span></span><br><span class="line"><span class="string">                        accepts any value from PIL.ImageColor.getcolor</span></span><br><span class="line"><span class="string">  --no_collocations     do not add collocations (bigrams) to word cloud</span></span><br><span class="line"><span class="string">                        (default: add unigrams and bigrams)</span></span><br><span class="line"><span class="string">  --version             show program'</span>s version number and exit</span><br></pre></td></tr></table></figure>
<h3 id="命令行录制工具asciinema"><a href="#命令行录制工具asciinema" class="headerlink" title="命令行录制工具asciinema"></a>命令行录制工具asciinema</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br></pre></td><td class="code"><pre><span class="line">pip3 install asciinema</span><br><span class="line">https:<span class="comment">//asciinema.org/docs/installation</span></span><br><span class="line">asciinema rec</span><br><span class="line">录制完成 ctrl+d 或 exit 退出，可保存到本地（json 格式），也可上传到 https:<span class="comment">//asciinema.org ，设置为 public 后可分享观看，而且官方提供多种方式很容易嵌入到自己对网站使用。</span></span><br><span class="line"></span><br><span class="line">https:<span class="comment">//asciinema.org/a/248319?t=5&amp;speed=3&amp;theme=solarized-dark</span></span><br><span class="line">视频链接后加 .png 对应的是分享用的视频截图：https:<span class="comment">//asciinema.org/a/248319.png ，而视频链接后加 .js 是可以站外直接调用的播放链接：</span></span><br><span class="line"></span><br><span class="line">&lt;script src=<span class="string">"https://asciinema.org/a/113463.js"</span> id=<span class="string">"asciicast-113463"</span> <span class="keyword">async</span> data-autoplay=<span class="string">"true"</span> data-size=<span class="string">"big"</span>&gt;&lt;/script&gt;</span><br><span class="line">https:<span class="comment">//learnku.com/articles/28920</span></span><br><span class="line"></span><br><span class="line">[root@VM_0_14_centos ~]# asciinema rec</span><br><span class="line">asciinema: recording asciicast to /tmp/tmpc_o6vho1-ascii.cast</span><br><span class="line">asciinema: press &lt;ctrl-d&gt; or type <span class="string">"exit"</span> when you<span class="string">'re done</span></span><br><span class="line"><span class="string">[root@VM_0_14_centos ~]# pip list</span></span><br><span class="line"><span class="string">DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won'</span>t be maintained after March <span class="number">2019</span> (cf PEP <span class="number">429</span>).</span><br><span class="line">Package          Version</span><br><span class="line">---------------- -----------</span><br><span class="line">argh             <span class="number">0.26</span><span class="number">.2</span></span><br><span class="line">arrow            <span class="number">0.13</span><span class="number">.2</span></span><br><span class="line">asciinema        <span class="number">2.0</span><span class="number">.2</span></span><br><span class="line">asn1crypto       <span class="number">0.24</span><span class="number">.0</span></span><br><span class="line">backports-abc    <span class="number">0.5</span></span><br><span class="line">beautifulsoup4   <span class="number">4.7</span><span class="number">.1</span></span><br><span class="line">binaryornot      <span class="number">0.4</span><span class="number">.4</span></span><br><span class="line">blinker          <span class="number">1.4</span></span><br><span class="line">brotlipy         <span class="number">0.7</span><span class="number">.0</span></span><br><span class="line">certifi          <span class="number">2019.3</span><span class="number">.9</span></span><br><span class="line">cffi             <span class="number">1.12</span><span class="number">.2</span></span><br><span class="line">chardet          <span class="number">3.0</span><span class="number">.4</span></span><br><span class="line">click            <span class="number">6.7</span></span><br><span class="line">configparser     <span class="number">3.7</span><span class="number">.3</span></span><br><span class="line">cookiecutter     <span class="number">1.6</span><span class="number">.0</span></span><br><span class="line">cryptography     <span class="number">2.3</span><span class="number">.1</span></span><br><span class="line">curlify          <span class="number">2.1</span><span class="number">.1</span></span><br><span class="line">future           <span class="number">0.17</span><span class="number">.1</span></span><br><span class="line">graphviz         <span class="number">0.8</span><span class="number">.4</span></span><br><span class="line">greenlet         <span class="number">0.4</span><span class="number">.15</span></span><br><span class="line">h11              <span class="number">0.7</span><span class="number">.0</span></span><br><span class="line">h2               <span class="number">3.1</span><span class="number">.0</span></span><br><span class="line">hiredis          <span class="number">1.0</span><span class="number">.0</span></span><br><span class="line">hpack            <span class="number">3.0</span><span class="number">.0</span></span><br><span class="line">hyperframe       <span class="number">5.2</span><span class="number">.0</span></span><br><span class="line">idna             <span class="number">2.8</span></span><br><span class="line">Jinja2           <span class="number">2.10</span><span class="number">.1</span></span><br><span class="line">jinja2-time      <span class="number">0.2</span><span class="number">.0</span></span><br><span class="line">kaitaistruct     <span class="number">0.8</span></span><br><span class="line">ldap3            <span class="number">2.5</span><span class="number">.2</span></span><br><span class="line">MarkupSafe       <span class="number">1.1</span><span class="number">.1</span></span><br><span class="line">mitmproxy        <span class="number">4.0</span><span class="number">.4</span></span><br><span class="line">msgpack          <span class="number">0.6</span><span class="number">.1</span></span><br><span class="line">mxnet-cu90       <span class="number">1.4</span><span class="number">.0</span>.post0</span><br><span class="line">numpy            <span class="number">1.14</span><span class="number">.6</span></span><br><span class="line">passlib          <span class="number">1.7</span><span class="number">.1</span></span><br><span class="line">pathtools        <span class="number">0.1</span><span class="number">.2</span></span><br><span class="line">peewee           <span class="number">3.9</span><span class="number">.2</span></span><br><span class="line">pip              <span class="number">19.0</span><span class="number">.3</span></span><br><span class="line">poyo             <span class="number">0.4</span><span class="number">.2</span></span><br><span class="line">pyasn1           <span class="number">0.4</span><span class="number">.5</span></span><br><span class="line">pycparser        <span class="number">2.19</span></span><br><span class="line">pyOpenSSL        <span class="number">18.0</span><span class="number">.0</span></span><br><span class="line">pyparsing        <span class="number">2.2</span><span class="number">.2</span></span><br><span class="line">pyperclip        <span class="number">1.6</span><span class="number">.5</span></span><br><span class="line">python-dateutil  <span class="number">2.8</span><span class="number">.0</span></span><br><span class="line">pytz             <span class="number">2018.9</span></span><br><span class="line">PyYAML           <span class="number">5.1</span></span><br><span class="line">redis            <span class="number">3.2</span><span class="number">.1</span></span><br><span class="line">requests         <span class="number">2.21</span><span class="number">.0</span></span><br><span class="line">ruamel.yaml      <span class="number">0.15</span><span class="number">.91</span></span><br><span class="line">setuptools       <span class="number">40.8</span><span class="number">.0</span></span><br><span class="line">six              <span class="number">1.12</span><span class="number">.0</span></span><br><span class="line">sortedcontainers <span class="number">2.0</span><span class="number">.5</span></span><br><span class="line">soupsieve        <span class="number">1.8</span></span><br><span class="line">thrift           <span class="number">0.11</span><span class="number">.0</span></span><br><span class="line">tornadis         <span class="number">0.8</span><span class="number">.1</span></span><br><span class="line">tornado          <span class="number">5.1</span></span><br><span class="line">torthrift        <span class="number">0.2</span><span class="number">.4</span></span><br><span class="line">tzlocal          <span class="number">1.5</span><span class="number">.1</span></span><br><span class="line">uncurl           <span class="number">0.0</span><span class="number">.8</span></span><br><span class="line">urllib3          <span class="number">1.24</span><span class="number">.1</span></span><br><span class="line">urwid            <span class="number">2.0</span><span class="number">.1</span></span><br><span class="line">watchdog         <span class="number">0.9</span><span class="number">.0</span></span><br><span class="line">wheel            <span class="number">0.33</span><span class="number">.1</span></span><br><span class="line">when-changed     <span class="number">0.3</span><span class="number">.0</span></span><br><span class="line">whichcraft       <span class="number">0.5</span><span class="number">.2</span></span><br><span class="line">wsproto          <span class="number">0.11</span><span class="number">.0</span></span><br><span class="line">xerox            <span class="number">0.4</span><span class="number">.1</span></span><br><span class="line">you-get          <span class="number">0.4</span><span class="number">.1256</span></span><br><span class="line">zdict            <span class="number">2.0</span><span class="number">.4</span></span><br><span class="line">You are using pip version <span class="number">19.0</span><span class="number">.3</span>, however version <span class="number">19.1</span><span class="number">.1</span> is available.</span><br><span class="line">You should consider upgrading via the <span class="string">'pip install --upgrade pip'</span> command.</span><br><span class="line">[root@VM_0_14_centos ~]# php -v</span><br><span class="line">PHP <span class="number">7.2</span><span class="number">.3</span> (cli) (built: Nov <span class="number">28</span> <span class="number">2018</span> <span class="number">12</span>:<span class="number">05</span>:<span class="number">00</span>) ( NTS )</span><br><span class="line">Copyright (c) <span class="number">1997</span><span class="number">-2018</span> The PHP Group</span><br><span class="line">Zend Engine v3<span class="number">.2</span><span class="number">.0</span>, Copyright (c) <span class="number">1998</span><span class="number">-2018</span> Zend Technologies</span><br><span class="line"></span><br><span class="line">[root@VM_0_14_centos ~]# exit</span><br><span class="line">asciinema: recording finished</span><br><span class="line">asciinema: press &lt;enter&gt; to upload to asciinema.org, &lt;ctrl-c&gt; to save locally</span><br><span class="line"></span><br><span class="line">View the recording at:</span><br><span class="line"></span><br><span class="line">    https:<span class="comment">//asciinema.org/a/IwvE2eERFLGCN1PeT0eIibwBG</span></span><br><span class="line"></span><br><span class="line">This installation <span class="keyword">of</span> asciinema recorder hasn<span class="string">'t been linked to any asciinema.org</span></span><br><span class="line"><span class="string">account. All unclaimed recordings (from unknown installations like this one)</span></span><br><span class="line"><span class="string">are automatically archived 7 days after upload.</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">If you want to preserve all recordings made on this machine, connect this</span></span><br><span class="line"><span class="string">installation with asciinema.org account by opening the following link:</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    https://asciinema.org/connect/01fb0f0e-c56a-450f-80ac-4020188dd957</span></span><br></pre></td></tr></table></figure>
<h3 id="Pyppeteer"><a href="#Pyppeteer" class="headerlink" title="Pyppeteer"></a>Pyppeteer</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><span class="line">pip3 install pyppeteer</span><br><span class="line">http:<span class="comment">//quotes.toscrape.com/js/，这个页面是 JavaScript 渲染而成的，用基本的 requests 库请求得到的 HTML 结果里面是不包含页面中所见的条目内容的。</span></span><br><span class="line"># 1 打开一个网页并做截图</span><br><span class="line"># 首次运行示例时，pyppeteer会自动下载对应操作系统的chromium</span><br><span class="line"><span class="keyword">import</span> asyncio</span><br><span class="line"><span class="keyword">from</span> pyppeteer <span class="keyword">import</span> launch</span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> def main():</span><br><span class="line">    browser = <span class="keyword">await</span> launch()</span><br><span class="line">    page = <span class="keyword">await</span> browser.newPage()</span><br><span class="line">    <span class="keyword">await</span> page.goto(<span class="string">'http://example.com'</span>)</span><br><span class="line">    <span class="keyword">await</span> page.screenshot(&#123;<span class="string">'path'</span>: <span class="string">'example.png'</span>&#125;)</span><br><span class="line">    <span class="keyword">await</span> browser.close()</span><br><span class="line"></span><br><span class="line">asyncio.get_event_loop().run_until_complete(main())</span><br><span class="line"></span><br><span class="line"># 2 在网页上执行一段脚本</span><br><span class="line"><span class="keyword">import</span> asyncio</span><br><span class="line"><span class="keyword">from</span> pyppeteer <span class="keyword">import</span> launch</span><br><span class="line"></span><br><span class="line"><span class="keyword">async</span> def main():</span><br><span class="line">    browser = <span class="keyword">await</span> launch()</span><br><span class="line">    page = <span class="keyword">await</span> browser.newPage()</span><br><span class="line">    <span class="keyword">await</span> page.goto(<span class="string">'http://example.com'</span>)</span><br><span class="line">    <span class="keyword">await</span> page.screenshot(&#123;<span class="string">'path'</span>: <span class="string">'example.png'</span>&#125;)</span><br><span class="line"></span><br><span class="line">    dimensions = <span class="keyword">await</span> page.evaluate(<span class="string">''</span><span class="string">'() =&gt; &#123;</span></span><br><span class="line"><span class="string">        return &#123;</span></span><br><span class="line"><span class="string">            width: document.documentElement.clientWidth,</span></span><br><span class="line"><span class="string">            height: document.documentElement.clientHeight,</span></span><br><span class="line"><span class="string">            deviceScaleFactor: window.devicePixelRatio,</span></span><br><span class="line"><span class="string">        &#125;</span></span><br><span class="line"><span class="string">    &#125;'</span><span class="string">''</span>)</span><br><span class="line"></span><br><span class="line">    print(dimensions)</span><br><span class="line">    # &gt;&gt;&gt; &#123;'width': 800, 'height': 600, 'deviceScaleFactor': 1&#125;</span><br><span class="line">    <span class="keyword">await</span> browser.close()</span><br><span class="line"></span><br><span class="line">asyncio.get_event_loop().run_until_complete(main())</span><br><span class="line"> https:<span class="comment">//www.jianshu.com/p/611ed6b75d47</span></span><br><span class="line"> </span><br><span class="line"> 打开网站并截图</span><br><span class="line"> <span class="keyword">import</span> asyncio</span><br><span class="line"> <span class="keyword">from</span> pyppeteer <span class="keyword">import</span> launch</span><br><span class="line"> <span class="keyword">async</span> def main():</span><br><span class="line">     browser = <span class="keyword">await</span> launch()</span><br><span class="line">     page = <span class="keyword">await</span> browser.newPage()</span><br><span class="line">     <span class="keyword">await</span> page.goto(<span class="string">'https://zhangslob.github.io/'</span>)</span><br><span class="line">     <span class="keyword">await</span> page.screenshot(&#123;<span class="string">'path'</span>: <span class="string">'zhangslob.png'</span>&#125;)</span><br><span class="line">     <span class="keyword">await</span> browser.close()</span><br><span class="line"> asyncio.get_event_loop().run_until_complete(main())</span><br><span class="line"></span><br><span class="line">第一次运行时需要下载Chromium，你可以提前在终端输入pyppeteer-install来下载</span><br><span class="line">λ pyppeteer-install</span><br><span class="line">[W:pyppeteer.chromium_downloader] start chromium download.</span><br><span class="line">Download may take a few minutes.</span><br></pre></td></tr></table></figure>
<h3 id="命令行录屏工具"><a href="#命令行录屏工具" class="headerlink" title="命令行录屏工具"></a>命令行录屏工具</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">pip install TermRecord</span><br><span class="line">它不会自动上传到网上，而是生成一个html文件，想要分享的话，你可以将其发送给好友。录制同样简单：</span><br><span class="line"></span><br><span class="line">TermRecord -o ggg.html</span><br><span class="line">同样使用exit或者Ctrl+D快捷键结束录制。要想查看录制结果，直接浏览器打开ggg.html就可以了。</span><br><span class="line"></span><br><span class="line">pip3 install asciinema</span><br><span class="line"></span><br><span class="line">	</span><br><span class="line">asciinema rec</span><br><span class="line">还是使用exit或者Ctrl+D快捷键结束录制。与showterm不同的是，它会在结束录制的时候提示，如果要上传的话，敲回车，这样就不至于把废品也上传了。上传之后，asciinema会给出一个网址，如：https:<span class="comment">//asciinema.org/a/44nu2i2ieywlmqq9wx5sk5k1e。要想嵌入到自己的网页上也没有问题：</span></span><br><span class="line"></span><br><span class="line">&lt;script type=<span class="string">"text/javascript"</span> src=<span class="string">"https://asciinema.org/a/44nu2i2ieywlmqq9wx5sk5k1e.js"</span> id=<span class="string">"asciicast-44nu2i2ieywlmqq9wx5sk5k1e"</span> <span class="keyword">async</span>&gt;&lt;/script&gt;</span><br><span class="line">如果不想上传，可以用这条命令将其保存为一个json文件：</span><br><span class="line"></span><br><span class="line">asciinema rec ggg.json</span><br><span class="line">使用以下命令可以查看录制结果：</span><br><span class="line"></span><br><span class="line">asciinema play ggg.json</span><br><span class="line">甚至可以再次上传：</span><br><span class="line"></span><br><span class="line">asciinema upload ggg.json</span><br><span class="line">还能通过asciinema auth命令并在asciinema上注册账号来管理自己上传的文件，功能上确实是这几个工具中最强大的</span><br><span class="line">http:<span class="comment">//qinghua.github.io/terminal-recorder/</span></span><br></pre></td></tr></table></figure>
<h3 id="音频拼接"><a href="#音频拼接" class="headerlink" title="音频拼接"></a>音频拼接</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"> pip install sox</span><br><span class="line">Collecting sox</span><br><span class="line">  Downloading https:<span class="comment">//files.pythonhosted.org/packages/60/a0/5bee540554af8376e0313e462629d95bf2f2bc3c8cb60697aa01254e6cf5/sox-1.3.7-py2.py3-none-any.whl</span></span><br><span class="line">Installing collected packages: sox</span><br><span class="line">Successfully installed sox<span class="number">-1.3</span><span class="number">.7</span></span><br><span class="line">You are using pip version <span class="number">19.0</span><span class="number">.3</span>, however version <span class="number">19.1</span><span class="number">.1</span> is available.</span><br><span class="line">You should consider upgrading via the <span class="string">'python -m pip install --upgrade pip'</span> command.</span><br><span class="line"><span class="keyword">import</span> sox</span><br><span class="line"></span><br><span class="line">    cbn = sox.Combiner()</span><br><span class="line">    data = [filename1,filename2]</span><br><span class="line">    cbn.build(data, new_file, <span class="string">'concatenate'</span>)</span><br><span class="line">终端执行：https:<span class="comment">//learnku.com/articles/30609</span></span><br><span class="line"> sox --combine concatenate <span class="number">1.</span>wav <span class="number">2.</span>wav out.wav</span><br></pre></td></tr></table></figure>
<h3 id="命令行获取磁力工具"><a href="#命令行获取磁力工具" class="headerlink" title="命令行获取磁力工具"></a>命令行获取磁力工具</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">$ git clone https:<span class="comment">//github.com/cexll/cilimao-cli.git</span></span><br><span class="line"> $ cd cilimao-cli</span><br><span class="line"> $ pip install -r requires.txt</span><br><span class="line"> $ python setup.py install</span><br><span class="line">磁力获取器命令行工具  pip install torrent-cli  https:<span class="comment">//github.com/chenjiandongx/torrent-cli</span></span><br><span class="line">λ cilimao-cli -h</span><br><span class="line">命令行磁力猫查询</span><br><span class="line">默认选择按视频排序,按下载热度排序</span><br><span class="line"></span><br><span class="line">Usage:</span><br><span class="line">    cilimao [-p] &lt;KEYWORD&gt;</span><br><span class="line">    cilimao [-h,--help]   显示帮助菜单</span><br><span class="line"></span><br><span class="line">Options:</span><br><span class="line">    -h,--help       显示帮助菜单</span><br><span class="line">    -p              页数(默认为<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">Example:</span><br><span class="line">    cilimao 复仇者联盟</span><br><span class="line">    cilimao -p <span class="number">1</span> 复仇者联盟</span><br><span class="line"></span><br><span class="line">d:\code\cilimao-cli (master)</span><br><span class="line">λ cilimao-cli 复仇者联盟</span><br><span class="line">Crawling data <span class="keyword">for</span> you.....</span><br><span class="line">磁链标题:  复仇者联盟<span class="number">3</span></span><br><span class="line">磁链地址: magnet:?xt=urn:btih:<span class="number">5</span>A1F3081715D0F38AABD13D4499EF4153A56184E</span><br><span class="line">文件数目:  <span class="number">1</span></span><br><span class="line">文件大小:  <span class="number">2.9139890475198627</span>GB</span><br><span class="line">创建时间:  <span class="number">2018</span><span class="number">-05</span><span class="number">-17</span> <span class="number">18</span>:<span class="number">33</span>:<span class="number">25</span></span><br></pre></td></tr></table></figure>
<h3 id="获取ip和WiFi"><a href="#获取ip和WiFi" class="headerlink" title="获取ip和WiFi"></a>获取ip和WiFi</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">$ pip install ng</span><br><span class="line">https:<span class="comment">//github.com/cls1991/ng</span></span><br><span class="line">Get your ip address:</span><br><span class="line"></span><br><span class="line">$ ng ip</span><br><span class="line"><span class="string">`</span></span><br><span class="line"><span class="string">local_ip:192.168.1.114</span></span><br><span class="line"><span class="string">public_ip:49.4.160.250</span></span><br><span class="line"><span class="string">`</span></span><br><span class="line">Get wifi password:</span><br><span class="line"></span><br><span class="line">$ ng wp</span><br><span class="line">$ ng wp flyfish_5g</span><br><span class="line"><span class="string">`</span></span><br><span class="line"><span class="string">flyfish_5g:hitflyfish123456</span></span><br><span class="line"><span class="string">`</span></span><br></pre></td></tr></table></figure>
<h3 id="5-秒抠图的-AI-神器"><a href="#5-秒抠图的-AI-神器" class="headerlink" title="5 秒抠图的 AI 神器"></a>5 秒抠图的 AI 神器</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">在网站上注册获取 API pip install removebg</span><br><span class="line"><span class="keyword">from</span> removebg <span class="keyword">import</span> RemoveBg</span><br><span class="line">rmbg = RemoveBg("WPZ2Q4fraseKfAN9PPxxxxxx", "error.log") # 引号内是你获取的API</span><br><span class="line">rmbg.remove_background_from_img_file("C:/Users/sony/Desktop/1.jpg") #图片地址</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> removebg <span class="keyword">import</span> RemoveBg</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"></span><br><span class="line">rmbg = RemoveBg(<span class="string">"WPZ2Q4fraseKfAN9PPxxxxxx"</span>, <span class="string">"error.log"</span>)</span><br><span class="line">path = '%s/picture'%os.getcwd() #图片放到程序的同级文件夹 picture 里面</span><br><span class="line"><span class="keyword">for</span> pic <span class="keyword">in</span> os.listdir(path):</span><br><span class="line">    rmbg.remove_background_from_img_file(<span class="string">"%s%s"</span>%(path,pic))</span><br><span class="line">  https:<span class="comment">//github.com/brilam/remove-bg</span></span><br></pre></td></tr></table></figure>
<h3 id="摩尔斯密码"><a href="#摩尔斯密码" class="headerlink" title="摩尔斯密码"></a>摩尔斯密码</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">pip install morse-talk</span><br><span class="line"><span class="keyword">import</span> morse_talk <span class="keyword">as</span> mtalk</span><br><span class="line">content = <span class="string">'i love you'</span></span><br><span class="line">mo_content = mtalk.encode(content)</span><br><span class="line">print mo_content</span><br><span class="line"><span class="keyword">import</span> morse_talk <span class="keyword">as</span> mtalk</span><br><span class="line">mo_content = <span class="string">'-.--   ---   ..-'</span></span><br><span class="line">content = mtalk.decode(mo_content)</span><br><span class="line">print content</span><br></pre></td></tr></table></figure>
<h3 id="电影字幕下载神器"><a href="#电影字幕下载神器" class="headerlink" title="电影字幕下载神器"></a>电影字幕下载神器</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">pip install subliminal</span><br><span class="line">subliminal download -l zh [电影名称]</span><br><span class="line"><span class="keyword">from</span> datetime <span class="keyword">import</span> timedelta</span><br><span class="line"> https:<span class="comment">//github.com/Diaoul/subliminal</span></span><br><span class="line"><span class="keyword">from</span> babelfish <span class="keyword">import</span> Language</span><br><span class="line"><span class="keyword">from</span> subliminal <span class="keyword">import</span> download_best_subtitles, region, save_subtitles, scan_videos</span><br><span class="line"> </span><br><span class="line"># configure the cache</span><br><span class="line">region.configure(<span class="string">'dogpile.cache.dbm'</span>, <span class="built_in">arguments</span>=&#123;<span class="string">'filename'</span>: <span class="string">'cachefile.dbm'</span>&#125;)</span><br><span class="line"> </span><br><span class="line"># scan for videos newer than 2 weeks and their existing subtitles in a folder</span><br><span class="line">videos = scan_videos(<span class="string">'/video/folder'</span>, age=timedelta(weeks=<span class="number">2</span>))</span><br><span class="line"> </span><br><span class="line"># download best subtitles</span><br><span class="line">subtitles = download_best_subtitles(videos, &#123;Language(<span class="string">'eng'</span>), Language(<span class="string">'fra'</span>)&#125;)</span><br><span class="line"> </span><br><span class="line"># save them to disk, next to the video</span><br><span class="line"><span class="keyword">for</span> v <span class="keyword">in</span> videos:</span><br><span class="line">    save_subtitles(v, subtitles[v])</span><br></pre></td></tr></table></figure>
<p><a href="https://linux.cn/article-5626-1.html" target="_blank" rel="noopener">命令行工具 Speedtest-CLI 来测试你的上下行网速</a></p>
<p><a href="http://kuanghy.github.io/2017/03/03/pythonpy" target="_blank" rel="noopener">一个命令行 Python 工具</a></p>
<p><a href="https://annual2018.pycourses.com/?hmsr=toutiao.io&amp;utm_medium=toutiao.io&amp;utm_source=toutiao.io#0" target="_blank" rel="noopener">2018python榜单</a></p>
<p><a href="https://learnxinyminutes.com/docs/zh-cn/python3-cn/" target="_blank" rel="noopener">10 分钟速成 Python3</a></p>
<p><a href="https://www.zhihu.com/question/19739424" target="_blank" rel="noopener">Windows 下有哪些替代 CMD 的命令行工具</a></p>
<p><a href="https://www.zhihu.com/question/59227720" target="_blank" rel="noopener">有哪些命令行的软件堪称神器</a></p>
<p><a href="https://juejin.im/post/5c3dcecef265da6163024b1c" target="_blank" rel="noopener">优秀的命令行工具整理</a></p>
<p><a href="https://www.cnblogs.com/haochuang/p/5593411.html" target="_blank" rel="noopener">10款Windows命令行工具</a></p>
<p><a href="https://github.com/maozhenggang/monkey-cheats" target="_blank" rel="noopener">一些能够改你效率的工具</a></p>
<p><a href="https://explainshell.com/" target="_blank" rel="noopener">shell</a></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/命令行/" rel="tag"># 命令行</a>
          
            <a href="/tags/工具/" rel="tag"># 工具</a>
          
            <a href="/tags/python/" rel="tag"># python</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/11/28/命令行工具收集/" rel="next" title="npm命令行工具收集">
                <i class="fa fa-chevron-left"></i> npm命令行工具收集
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/11/30/go命令行工具/" rel="prev" title="go命令行工具">
                go命令行工具 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
          <div class="comments" id="comments">
             <div id="gitment-container"></div>
         </div>
  




        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">苏生不惑</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">382</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">37</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/sushengbuhuo" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mysusheng@gmail.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://plus.google.com/mysusheng" target="_blank" title="Google">
                      
                        <i class="fa fa-fw fa-google"></i>Google</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://v2ex.com/" title="v2ex" target="_blank">v2ex</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.fanhaobai.com/" title="fanhaobai" target="_blank">fanhaobai</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://yuanxuxu.com/archives/" title="yuanxuxu" target="_blank">yuanxuxu</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.snail-c.cn/article" title="snail-c" target="_blank">snail-c</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://showcj.com/archives" title="showcj" target="_blank">showcj</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://vultr.aicnm.com/%E6%9C%80%E6%96%B0Vultr%E6%B3%A8%E5%86%8C%E5%8F%8AVPS%E8%B4%AD%E4%B9%B0%E5%9B%BE%E6%96%87%E6%95%99%E7%A8%8B/" title="vultr" target="_blank">vultr</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.lucissfer.com/" title="lucissfer" target="_blank">lucissfer</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.csdn.net/fdipzone/article/details/79352685" title="傲雪星枫" target="_blank">傲雪星枫</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.yoby123.cn/index.php/category/default/" title="小白的分享" target="_blank">小白的分享</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.cnblogs.com/52fhy/p/5819995.html" title="PHP攻城狮" target="_blank">PHP攻城狮</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.jiaojie.site/" title="php" target="_blank">php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://sphard.com/archives/" title="sphard" target="_blank">sphard</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://yuanxuxu.com/archives/" title="LNMP技术栈笔记" target="_blank">LNMP技术栈笔记</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.coding10.com/" title="学习 Laravel" target="_blank">学习 Laravel</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://shuwoom.com/?page_id=929" title="区块链学习指南" target="_blank">区块链学习指南</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://greenlightt.github.io/archives/" title="greenlightt" target="_blank">greenlightt</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.0php.net/archives/" title="0php" target="_blank">0php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.fordba.com/category/mysql" title="mysql" target="_blank">mysql</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.itcodemonkey.com/" title="程序员" target="_blank">程序员</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.yanshuo.me/r/v2ex" title="言说" target="_blank">言说</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.timiguo.com/archive.html" title="提米果的博客" target="_blank">提米果的博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://phpartisan.cn/news/112.html" title="phpartisan" target="_blank">phpartisan</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.cnblogs.com/52fhy/" title="飞鸿影" target="_blank">飞鸿影</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.54php.cn/" title="54php" target="_blank">54php</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.lazyman.vip/" title="营销" target="_blank">营销</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.njphper.com/archives/" title="做人呢最重要的就是开心" target="_blank">做人呢最重要的就是开心</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.h57.pw/" title="php 初心者" target="_blank">php 初心者</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#安装python3"><span class="nav-number">1.</span> <span class="nav-text">安装python3</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#显示Python包"><span class="nav-number">2.</span> <span class="nav-text">显示Python包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#视频下载you-get"><span class="nav-number">3.</span> <span class="nav-text">视频下载you-get</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#httpie"><span class="nav-number">4.</span> <span class="nav-text">httpie</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#清晰易读的-cURL-工具httpstat"><span class="nav-number">5.</span> <span class="nav-text">清晰易读的 cURL 工具httpstat</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#shadowsocks"><span class="nav-number">6.</span> <span class="nav-text">shadowsocks</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#增强型语法高亮mycli"><span class="nav-number">7.</span> <span class="nav-text">增强型语法高亮mycli</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#中文分词"><span class="nav-number">8.</span> <span class="nav-text">中文分词</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#测试你的上下行网速"><span class="nav-number">9.</span> <span class="nav-text">测试你的上下行网速</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#cheat"><span class="nav-number">10.</span> <span class="nav-text">cheat</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#zhihu"><span class="nav-number">11.</span> <span class="nav-text">zhihu</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#微信机器人"><span class="nav-number">12.</span> <span class="nav-text">微信机器人</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数据可视化"><span class="nav-number">13.</span> <span class="nav-text">数据可视化</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#直接执行简单-Python-表达式"><span class="nav-number">14.</span> <span class="nav-text">直接执行简单 Python 表达式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ppt-转-pdf-图片"><span class="nav-number">15.</span> <span class="nav-text">ppt 转 pdf 图片</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#二维码"><span class="nav-number">16.</span> <span class="nav-text">二维码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#数据分析"><span class="nav-number">17.</span> <span class="nav-text">数据分析</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#uncurl"><span class="nav-number">18.</span> <span class="nav-text">uncurl</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#词云"><span class="nav-number">19.</span> <span class="nav-text">词云</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#命令行录制工具asciinema"><span class="nav-number">20.</span> <span class="nav-text">命令行录制工具asciinema</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Pyppeteer"><span class="nav-number">21.</span> <span class="nav-text">Pyppeteer</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#命令行录屏工具"><span class="nav-number">22.</span> <span class="nav-text">命令行录屏工具</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#音频拼接"><span class="nav-number">23.</span> <span class="nav-text">音频拼接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#命令行获取磁力工具"><span class="nav-number">24.</span> <span class="nav-text">命令行获取磁力工具</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#获取ip和WiFi"><span class="nav-number">25.</span> <span class="nav-text">获取ip和WiFi</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-秒抠图的-AI-神器"><span class="nav-number">26.</span> <span class="nav-text">5 秒抠图的 AI 神器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#摩尔斯密码"><span class="nav-number">27.</span> <span class="nav-text">摩尔斯密码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#电影字幕下载神器"><span class="nav-number">28.</span> <span class="nav-text">电影字幕下载神器</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">苏生不惑</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>



<div>
<span id="showDays"></span>

</div>

<span id="busuanzi_container_site_pv">
   总访问量:<span id="busuanzi_value_site_pv"></span>次
</span>



  <span class="post-meta-divider">|</span>



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共773.8k字</span>
</div>
<script>
var birthDay = new Date("11/20/2018");
var now = new Date();
var duration = now.getTime() - birthDay.getTime();
var total= Math.floor(duration / (1000 * 60 * 60 * 24));
document.getElementById("showDays").innerHTML = "本站已运行 "+total+" 天";
</script>

        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      人次
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  











<script type="text/javascript">
    (function() {
        // 匿名函数，防止污染全局变量
        var utterances = document.createElement('script');
        utterances.type = 'text/javascript';
        utterances.async = true;
        utterances.setAttribute('issue-term','0')
        utterances.setAttribute('theme','')
        utterances.setAttribute('repo','sushengbuhuo/laravel_ioc_demo')
        utterances.crossorigin = 'anonymous';
        utterances.src = 'https://utteranc.es/client.js';
        // content 是要插入评论的地方
        document.getElementById('gitment-container').appendChild(utterances);
    })();
</script>


  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

  
<script>
  ((window.gitter = {}).chat = {}).options = {
    //room替换成自己的聊天室名称即可，room的名称规则是：username/roomname
    room: 'sushengbuhuo-chat/mychat'
  };
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>

</body>
</html>
